<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('试卷包名')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input type="text" class="form-control" data-rule="required" name="row[paper_name]" placeholder="请输入试卷包名称" id="" value="{$info['paper_name']|default=''}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('排序')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-en_name" data-rule="required" class="form-control" name="row[sort]" type="number" placeholder="请输入排序" value="{$info['sort']|default='0'}">
        </div>
    </div>
    <input type="hidden" title="历年真题需要使用该字段" name="row[library]" value="0" class="library">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('试卷类型')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio paper-type">
                {if condition="isset($info)"}
                <label for="paper_type1">
                    <input type="radio" name="row[paper_type]" value="1" id="paper_type1" {eq name="$info->getData('paper_type')" value="1"}checked{/eq}>正式考试
                </label>
                <label for="paper_type2">
                    <input type="radio" name="row[paper_type]" value="2" id="paper_type2" {eq name="$info->getData('paper_type')" value="2"}checked{/eq}>模拟考试
                </label>
                <label for="paper_type3">
                    <input type="radio" name="row[paper_type]" value="3" id="paper_type3" {eq name="$info->getData('paper_type')" value="3"}checked{/eq}>付费试卷
                </label>
                <label for="paper_type4">
                    <input type="radio" name="row[paper_type]" value="4" id="paper_type4" {eq name="$info->getData('paper_type')" value="4"}checked{/eq}>历年真题
                </label>
                {else/}
                <label for="paper_type1">
                    <input type="radio" name="row[paper_type]" value="1" id="paper_type1" checked>正式考试
                </label>
                <label for="paper_type2">
                    <input type="radio" name="row[paper_type]" value="2" id="paper_type2" >模拟考试
                </label>
                <label for="paper_type3">
                    <input type="radio" name="row[paper_type]" value="3" id="paper_type3" >付费试卷
                </label>
                <label for="paper_type4">
                    <input type="radio" name="row[paper_type]" value="4" id="paper_type4" >历年真题
                </label>
                {/if}
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('试卷')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="checkbox papers">
                <div class="p1">
                    {volist name="questions['paper']" id="item"}
                    <label for="qid{$item.id}">
                        <input type="checkbox" name="row[papers][]" value="{$item.id}" id="qid{$item.id}" {$item.check|default=""}>{$item.exam_name}
                    </label>
                    {/volist}
                </div>
                <div class="p2" style="display: none;">
                    {volist name="$test['paper']" id="item"}
                    <label for="tid{$item.id}">
                        <input type="checkbox" name="row[papers][]" value="{$item.id}" id="tid{$item.id}" {$item.check|default=""}>{$item.exam_name}
                    </label>
                    {/volist}
                </div>
                <div class="p3" style="display: none;">
                    {volist name="$fee['paper']" id="item"}
                    <label for="id{$item.id}">
                        <input type="checkbox" name="row[papers][]" value="{$item.id}" id="id{$item.id}" {$item.check|default=""}>{$item.exam_name}
                    </label>
                    {/volist}
                </div>
                <div class="p4" style="display: none;">
                    {volist name="$historyList['paper']" id="item"}
                    <label for="history{$item.id}">
                        <input type="checkbox" name="row[papers][]" value="{$item.id}" id="history{$item.id}" {$item.check|default=""}>{$item.library_name}
                    </label>
                    {/volist}
                </div>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">章节</label>
        <div class="col-xs-12 col-sm-8">
            <div class="checkbox papers">
                <div class="p1">
                    {volist name="questions['unit']" id="item" empty="无试章节"}
                    <div style="padding: 6px 0;">
                        {$item.unit_name}
                        <button type="button" class="btn btn-primary btn-xs import-exam" data-id="{$item.id}" data-type="1">{if condition="$item.unit_id == $item.id"} 已导入 {else/} 导入 {/if}</button>
                    </div>
                    {/volist}
                </div>
                <div class="p2" style="display: none">
                    {volist name="$test['unit']" id="item" empty="无试章节"}
                    <div style="padding: 6px 0;">
                        {$item.unit_name}
                        <button type="button" class="btn btn-primary btn-xs import-exam" data-id="{$item.id}" data-type="2">{if condition="$item.unit_id == $item.id"} 已导入 {else/} 导入 {/if}</button>
                    </div>
                    {/volist}
                </div>
                <div class="p3" style="display: none">
                    {volist name="$fee['unit']" id="item" empty="无试章节"}
                    <div style="padding: 6px 0;">
                        {$item.unit_name}
                        <button type="button" class="btn btn-primary btn-xs import-exam" data-id="{$item.id}" data-type="3">{if condition="$item.unit_id == $item.id")} 已导入 {else/} 导入 {/if}</button>
                    </div>
                    {/volist}
                </div>
                <div class="p4" style="display: none">
                    {volist name="$historyList['unit']" id="item" empty="无试章节"}
                    <div style="padding: 6px 0;">
                        {$item.unit_name}
                        <button type="button" class="btn btn-primary btn-xs import-exam" data-id="{$item.id}" data-type="4">{if condition="$item.unit_id == $item.id")} 已导入 {else/} 导入 {/if}</button>
                    </div>
                    {/volist}
                </div>
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8 text-danger">(注：章节和试卷只能二者选择其一)</div>
    </div>
    <input type="hidden" name="row[subject_id]" value="{$subject_id}" title="后台需要绑定科目">
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
